﻿@model Stardust.Models.TipoHabitacionXHotelViewModelCreate

@{
    ViewBag.Title = "Asignar tipo de habitacion";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<h2>@ViewBag.Title</h2>

@Html.ValidationSummary(true)

@using (@Html.BeginForm("CreateTipoHabitacionXHotel", "Hotel", FormMethod.Post, new { @class = "form" }))
{ 
    <fieldset>
        <div class = "widget" >
            <div class = "title" >
                <img src="@Url.Content("~/Content/images/icons/dark/list.png")" alt class="titleIcon">
                <h6>@ViewBag.Title</h6>
            </div>

            <div class = "formRow" >
                @Html.LabelFor(model => model.idHotel)
                <div class = "formRight" > 
                    @Html.DropDownListFor(model => model.idHotel, new SelectList(Model.Hoteles, "ID", "nombre", Model.idHotel), "Elija un hotel...")
                    @Html.ValidationMessageFor(model => model.idHotel)
                </div>
                <div class = "clear" ></div>
            </div>

            <div style="display:none">
                @for (int i = 0; i < Model.Hoteles.Count; i++)
                {
                    @Html.HiddenFor(m => m.Hoteles[i].ID)
                    @Html.HiddenFor(m => m.Hoteles[i].nombre)
                }
            </div>

            <div class = "formRow" >
                @Html.LabelFor(model => model.idTipoHabitacion)
                <div class = "formRight" >
                    @Html.DropDownListFor(model => model.idTipoHabitacion, new SelectList(Model.TipoHabitaciones, "idTipoHabitacion", "nombre", Model.idTipoHabitacion), "Elija un tipo de habitación...")
                    @Html.ValidationMessageFor(model => model.idTipoHabitacion)
                </div>
                <div class = "clear" ></div>
            </div>

            <div style="display:none">
                @for (int i = 0; i < Model.TipoHabitaciones.Count; i++)
                {
                    @Html.HiddenFor(m => m.TipoHabitaciones[i].idTipoHabitacion)
                    @Html.HiddenFor(m => m.TipoHabitaciones[i].nombre)
                }
            </div>

            <div class = "formRow" >
                @Html.LabelFor(model => model.precio)
                <div class = "formRight" >
                    @Html.TextBoxFor(model => model.precio)
                    @Html.ValidationMessageFor(model => model.precio)
                </div>
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" >
                @Html.LabelFor(model => model.nroPersonas)
                <div class = "formRight" >
                    @Html.TextBoxFor(model => model.nroPersonas)
                    @Html.ValidationMessageFor(model => model.nroPersonas)
                </div>
                <div class = "clear" ></div>
            </div>
        </div>
        <p>
            <input class = "redB" type="submit" value="Asignar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Regresar", "ListTiposHabitacionXHotel", new { id = Model.idHotel })
</div>